realtek: pcs: rtl838x: transplant firmware config
authorJonas Jelonek <[email protected]>
Fri, 7 Nov 2025 10:21:43 +0000 (10:21 +0000)
committerHauke Mehrtens <[email protected]>
Mon, 8 Dec 2025 23:28:27 +0000 (00:28 +0100)
commit6a5cae7d74914e947e2cd3a01a1b2b6ea7e813be
treeb18895346cd2fe065614054a819ee9ff5e9eabbe
parent328b970ecd8d43fe7ce73e23e584c984ee820a03
realtek: pcs: rtl838x: transplant firmware config

In the PHY driver, firmware files were used to store configuration
values for the SerDes which need to be applied upon initialization.
There are several issues which prevent to just take that over into the
PCS driver:
* SerDes and PHY parts are mixed within a firmware file
* SerDes access in PHY driver is based on writing into the switch's
  global register space; PCS driver uses access via MDIO interface
  --> destination values do not match
* firmware file format is not SerDes-agnostic
* no documentation or script for the "old" firmware files

Unfortunately, there is no proper firmware format yet where to take over
the required sequences. Thus, extract the sequences needed for RTL838X
SerDes, transform them to work with the MDIO based access and put them
as functions in the PCS driver.

Note that this should just be a temporary solution. In a next step, a
proper firmware format should be established and all configuration
sequences currently in the code should be moved into firmware files.

Signed-off-by: Jonas Jelonek <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c